Electronic devices such as tablet computers include displays. A cover may be used to help protect a display in a tablet computer from damage. A magnet may be placed in a flexible cover and a corresponding magnetic sensor such as a Hall effect sensor may be provided in a tablet computer. During operation, the tablet computer can use the magnetic sensor to determine whether the magnet is present and therefore determine whether or not the flexible cover is open or closed. In response to determining the state of the cover, the tablet computer can take actions such as placing the device in a sleep state when the cover is present or awakening the device from the sleep state when the cover is not present.
Magnetic field interference from magnets in covers may give rise to challenges for sensitive components such as compass sensors and cameras. Covers may also fail to offer users desired functionality.